﻿<?php
require ('../config.php');

$kdPay = new KDPay($P_UserId,$SalfStr);
//获取页面传递的充值参数
$faveValue = $_POST['faceValue'];
$pd_id = $_POST['pd_FrpId'];


//设置存储网关的文件
$kdPay->initialGatewayTXT($restoreGatewayTXT);

//设置充值方式
$kdPay->setPayChannel( $pd_id );
//设置金额
$kdPay->setFaveValue($faveValue);
//设置同步和异步地址
$kdPay->setNotifyAndResult($notify_url,$result_url);

//获取跳转地址
$redirect_url = $kdPay->getRedirectUrl('bank');



/************************
 * 下步进行订单入库保存
 * 订单号为$kdpay->getOrder();
 */
//下面这句是提交到API
header("location:$redirect_url");

?>